package cn.iocoder.yudao.module.ao.dal.mysql.classlocation;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.ao.dal.dataobject.classlocation.ClassLocationDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.ao.controller.admin.classlocation.vo.*;

/**
 * 上课场地信息 Mapper
 *
 * @author 智教云枢
 */
@Mapper
public interface ClassLocationMapper extends BaseMapperX<ClassLocationDO> {

    default PageResult<ClassLocationDO> selectPage(ClassLocationPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ClassLocationDO>()
                .likeIfPresent(ClassLocationDO::getLocationName, reqVO.getLocationName())
                .eqIfPresent(ClassLocationDO::getBuildingId, reqVO.getBuildingId())
                .eqIfPresent(ClassLocationDO::getFloor, reqVO.getFloor())
                .likeIfPresent(ClassLocationDO::getRoomNumber, reqVO.getRoomNumber())
                .eqIfPresent(ClassLocationDO::getLocationType, reqVO.getLocationType())
                .eqIfPresent(ClassLocationDO::getManagerId, reqVO.getManagerId())
                .eqIfPresent(ClassLocationDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(ClassLocationDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ClassLocationDO::getLocationId));
    }

}